<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/6/3
 * Time: 14:29
 */

namespace app\vehicle\model;
use think\Model;

class ExchangeLog extends Model
{
    public function exchange(){
        return $this->hasOne('exchange','id','exchange_id')->bind([
            'title','integral'
        ]);
    }
    public function userName(){
        return $this->hasOne('user','id','user_id')->bind([
            'nick_name'=>'nick_name'
        ]);
    }
    public function getCreateTimeAttr($value){
        return date('Y-m-d',$value);
    }
}